• File: db_run_sql.php
  • Full Path: C:/htdocs/reeft_gps_test/css/include/db_run_sql.php
  • Date Modified: 04/30/2025 7:56 AM
  • File size: 1.88 KB
  • MIME-type: text/x-php
  • Charset: utf-8
<?php
//======================================================================================
//
// Function: Run a SQL statement against some database
//
// NOTE: config.php must have been include before you include this!
//
// Programmer: JKJ
// Date      : 2022-01-06
//
// ------------------------------------------------------------------------------------------
// One year since the crazy fvcking Trump supporters tried to overcome US democracy.
// FVCK TRUMP AND ALL HIS SUPPORTERS AND DF AND NY BOGERLIGE AND ALL RIGHT WING SHITHEADS!!!!
// ------------------------------------------------------------------------------------------
//
// Copyright Reeft A/S (c) - 2021
//======================================================================================

	if ( $DFT_DATABASE_TO_USE == '*MYSQL') {


		$result = $file_db->prepare( $sql );
		$result->execute();
		$current_elm = $result->rowCount();

		@$last_id = $file_db->lastInsertId();

			// Fetch the next row of a result set as an associative array
			try {

				$data = $result->fetchAll(PDO::FETCH_ASSOC);

			} catch (PDOException $e) {
				//echo "Connection failed: " . $e->getMessage();
			}

	}
	else if ( $DFT_DATABASE_TO_USE == '*MARIA_DB') {


		$result = $file_db->prepare( $sql );
		$result->execute();
		$current_elm = $result->rowCount();

		@$last_id = $file_db->lastInsertId();

			// Fetch the next row of a result set as an associative array
			try {

				$data = $result->fetchAll(PDO::FETCH_ASSOC);

			} catch (PDOException $e) {
				//echo "Connection failed: " . $e->getMessage();
			}

	}
	else
	{

		$result = $file_db->prepare( $sql );
		$result->execute();
		$current_elm = $result->rowCount();

		@$last_id = $file_db->lastInsertId();

		// Fetch the next row of a result set as an associative array
		$data = $result->fetchAll( PDO::FETCH_ASSOC );

	}


?>